package com.xtayfjpk.spring.security.test.config;

import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;

import org.springframework.security.web.util.matcher.RequestMatcher;

public class MyRequestMatcher implements RequestMatcher {
	private Pattern allowedMethods = Pattern.compile("^(GET|HEAD|TRACE|OPTIONS)$");

	
	@Override
	public boolean matches(HttpServletRequest request) {
		String uri = request.getRequestURI();
		System.out.println(uri);
		return !allowedMethods.matcher(request.getMethod()).matches() && !uri.equals("/spring-security-test/dologin");
	}

}
